// TOWN DIALOGUE SCRIPT
//    Town 4: Resistance

// This is the dialogue for this town.
// You can use states numbered from 1 to 99.

begintalkscript;

variables;

int i,j,k,r1,choice;
short lead_char;


begintalknode 1;
	state = -1;
	personality = 13;
	nextstate = -1;
	condition = 1;
	question = "Leaders";
	text1 = "Suvar, Klinger, and Valzier are discussing plans for the future of the resistance. Klinger is filled with suggestions about where they should go next, while Valzier explains the relevant pieces of the Asmur scrolls.";
 text2 = "Suvar listens to each carefully. Often there are disagreements, but like any strong leader, he is able to reach a compromise between the two or at least explain why one is correct and the other wrong.";
 text3 = "Unfortunately, they are far too busy to speak with you right now.";
code =
 end();
break;

begintalknode 2;
	state = -1;
	personality = 14;
	nextstate = 1;
	condition = 1;
	question = "Noland";
	text1 = "The guard stands at attention, observing you carefully. He has never seen people from off this island before, and he is undoubtedly curious, if not a little afraid.";
 text2 = "Eventually, you break the tension and introduce yourselves. In turn, he proudly pronounces, _I'm Noland. I'm a resistance fighter!_";

begintalknode 3;
	state = 1;
	personality = 14;
	nextstate = -1;
	condition = 1;
	question = "Why did you join the resistance?";
	text1 = "His eyes get angry, _They killed my village, but many of us escaped. We hid for weeks, but were captured. The resistance attacked and rescued us. All the survivors joined._";
 text2 = "_Arivan must pay for her crimes,_ he mutters coldly.";

begintalknode 4;
	state = 1;
	personality = 14;
	nextstate = 2;
	condition = 1;
	question = "What's behind the door?";
	text1 = "He pauses, not sure if he should tell you. _A bunch of tunnels that lead deeper into this hill. There's also something the shamans are interested in. I hear it's some kind of doorway to many places._";
 code =
  set_flag(3,14,1);
 break;

begintalknode 5;
	state = 2;
	personality = 14;
	nextstate = -1;
	condition = 1;
	question = "Think we could see it?";
	text1 = "He shakes his head. _My orders are not to let anyone past without permission. Only Suvar can give that. Until I hear otherwise, I must keep you away._";
 text2 = "The Imperial Army would admire this young Nephil's obedience.";

begintalknode 6;
	state = -1;
	personality = 15;
	nextstate = 3;
	condition = 1;
	question = "Andra";
	text1 = "This young Nephil woman protects this doorway with a crude, but effective, short sword. She is made nervous by an outsider's presence, but tries to look at you as if she has no fear.";

begintalknode 7;
	state = 3;
	personality = 15;
	nextstate = 4;
	condition = 1;
	question = "Who are you and why did you join the resistance?";
	text1 = "_I'm Andra. I guard this passage._ She pauses briefly. _I came after the people in my village mysteriously vanished. Several of us were out gathering berries, when we returned they were gone._";
	text2 = "_We were scared and alone, but then Klinger came and brought us here. That was three years ago._";

begintalknode 8;
	state = 4;
	personality = 15;
	nextstate = 5;
	condition = 1;
	question = "Did you ever find out what happened to the people of your village?";
	text1 = "She looks down. _They were murdered by the shaman, not our shaman, but an imposter from Vikida. They say he is able to assume the identity of other people using his magic._";
 text2 = "_I've heard all the bodies were placed in a compartment behind the shrine. I haven't the courage to go back there yet._";

begintalknode 9;
	state = 5;
	personality = 15;
	nextstate = -1;
	condition = 1;
	question = "Do you know anything about this imposter?";
	text1 = "She shakes her head. _They say he kills an important member of a tribe and assumes his identity._ She pauses. _Come to think of it, he could even be here. We should watch for him carefully._";
 text2 = "_Believe me, what I wouldn't give for the chance..._ her voice trails off.";

begintalknode 10;
	state = 5;
	personality = 15;
	nextstate = -1;
	condition = 1;
	question = "Out of curiosity, where was your village?";
	text1 = "She thinks of the best way to describe it. _Not far from Vikida, if you know where that is._ You nod. _Southwest of it._";
 text2 = "_I wouldn't go there. Not much left anyway._";
 text3 = "You are willing to bet that was the first village you encountered. At least you know a little more now.";

begintalknode 11;
	state = 3;
	personality = 15;
	nextstate = 7;
	condition = 1;
	question = "What's past the door?";
	text1 = "_A lab. Oh, and the escape tunnel, just in case._ she replies. _Can't go back there without permission from Suvar._";
 code =
  set_flag(3,15,1);
 break;

begintalknode 12;
	state = 7;
	personality = 15;
	nextstate = -1;
	condition = 1;
	question = "Tell me about the lab.";
	text1 = "She shrugs. _I'm a fighter, not some shaman. Only Suvar, the shamans, and a few other leaders like Klinger are allowed back there. Even if I wanted to poke around, doubt I'd understand that magic stuff._";

begintalknode 13;
	state = 7;
	personality = 15;
	nextstate = -1;
	condition = 1;
	question = "Where does the escape passage lead?";
	text1 = "_I don't know. I just make sure nobody gets to it who isn't supposed to. I hear it opens up somewhere in the forest not far from here. It's really hard to find from the outside, I was told._";

begintalknode 14;
	state = -1;
	personality = 16;
	nextstate = 8;
	condition = 1;
	question = "Olander";
	text1 = "A very old Nephil Shaman with graying fur putters about with a limp in this crude magic lab. He looks you over carefully with his clouded and ancient eyes that seem to peer deep into your essence.";
 text2 = "He nods and introduces himself, _I am Olander. Welcome, I take it you come from far beyond. I have long wondered about the world past the sea. I would like to ask you some questions some time._";

begintalknode 15;
	state = 8;
	personality = 16;
	nextstate = -1;
	condition = 1;
	question = "What do you want to know about the outside world?";
	text1 = "_Oh, many things,_ he replies with a low and scratchy voice. _Many things indeed..._ he trails. _But you look tired, and I wish to think about my questions before asking. There will be time later._";

begintalknode 16;
	state = 8;
	personality = 16;
	nextstate = 9;
	condition = 1;
	question = "How did you come to be a part of the resistance?";
	text1 = "He smiles. _I was actually a founding member, along with Suvar and a few others who have fallen in our war._";
 text2 = "_Suvar was originally a leader in the Vikida army, a friend of Arivan. I suspect more than friends actually. He helped her come to power, an act that he regrets. But that was before she became mad._";
 text3 = "_I knew Suvar in those days. I had a hut not far from Vikida. Back then it was just a normal village and not some great city like Asmur. I'm an exile from there, after the civil war._";

begintalknode 17;
	state = 9;
	personality = 16;
	nextstate = 10;
	condition = 1;
	question = "Tell me about Arivan and Suvar.";
	text1 = "He sighs. _I never really knew Arivan. She was always a bright shaman, the best in her tribe. She had many great ideas for the advancement of her tribe, none of them involved the quest for purity that now consumes her._";
 text2 = "_After the old chieftain died with no heir, there was a struggle for power. Suvar helped Arivan come to power. They were both leaders. She led the civil affairs and he the soldiers. Vikida became a powerful force like Asmur was._";
 text3 = "_But then Arivan began to think sick thoughts, the same thoughts that once plagued the people of Asmur. A need to perfect, to purify, to cleanse. These thoughts were contagious and infected the tribe like a disease._";
 text4 = "_Suvar refused to execute the people of his own village for such non-offenses as being imperfect. He was labeled a dissident, and Arivan had more pull than he. They tried to assassinate him, but he escaped._";
 text5 = "_He came to me and told me of this. It was Asmur all over again. I knew of these caves, so we came here. We've fought her ever since. The rest is history._";

begintalknode 18;
	state = 10;
	personality = 16;
	nextstate = -1;
	condition = 1;
	question = "Why do you consider Arivan's goals a disease?";
	text1 = "_I have long pondered that question. I make no secret that in Asmur I felt the way Arivan did, but I was able to break free. Many were not and were killed in a bloody affair, twenty plus years ago now._";
 text2 = "_What is troublesome is that it does not just affect one person, it affects many and all at the same time, in a certain area. That was true of both Asmur and Vikida. It is a strange and contagious mental plague._";
 text3 = "_How and why it occurs, I wish I knew. If only I could just figure it out and stop it. Maybe that way the horrors can leave this forest forever._";

begintalknode 19;
	state = 9;
	personality = 16;
	nextstate = 11;
	condition = 1;
	question = "I want to know more about Asmur.";
	text1 = "_That was so long ago. It was like another life..._ he trails. A long pause follows as he sums up the tired story he has undoubtedly said many times.";
 text2 = "_A long time ago, a sizable group of people in the tribe became infatuated with this idea of purifying the rest of the tribe and the entire island. We needed to make the perfect tribe and then the perfect forest._";
 text3 = "_We attempted to overthrow the leaders at the time and were crushed. I make no secret that I was involved. I am guilty of mass murder and was exiled when all was said and done._";
 text4 = "_The tribe was devastated. They turned drastically inward, blaming the outside world for their horrid revolution. The closed off all contact and became paranoid, avoiding the concepts of purity by execution at all cost._";
 text5 = "_I managed to break free of those thoughts. I thought it was over forever. But I was wrong, dead wrong._ he says lamentingly. _I wish we would've learned the first time._ He shakes his head disparagingly.";

begintalknode 20;
	state = 11;
	personality = 16;
	nextstate = -1;
	condition = 1;
	question = "I regret to inform you Vikida has slaughtered Asmur.";
	text1 = "He shrugs. _I know. As I said, it was another life. I lost very much during those bloody times, more than most will ever know. Now they are all erased forever. The past was just a dream..._";

begintalknode 21;
	state = 11;
	personality = 16;
	nextstate = -1;
	condition = 1;
	question = "An emisarry from Asmur has come named Valzier. Do you know him?";
	text1 = "_No, but I've seen him. He's young and after my time. It was so long ago. I bet he is too young to remember those dark days. Pity he had to relive the nightmare of my time. Hopefully he will only see this madness once._";

begintalknode 22;
	state = 8;
	personality = 16;
	nextstate = -1;
	condition = 1;
	question = "What do you know about the strange machines here?";
	text1 = "_I study them. They are very strange and far beyond anything we know. We have difficulty even comprehending their function. We do not yet understand why they work, but we've figured out how to operate some of them._";
 text2 = "_I suspect they are hundreds, if not thousands, of years old. Most of the relics are far beyond usefulness; however, many have still survived. We use one set of devices to shield this place._";
 text3 = "_Also, the machines are highly resistant scrying. This makes them hard to probe, but it really helps to shield this entire area from Arivan and her prying shamans._";
 text4 = "Well, at least now you have some idea why the wizards back home were dead wrong about there being no intelligent life on this island.";

begintalknode 23;
	state = 8;
	personality = 16;
	nextstate = 12;
	condition = 1;
	question = "Can you assist us?";
	text1 = "_Yes. I help all those who help the resistance. I can teach you some magic, and my knowledge of lore can help identify your items. I charge since often we have to trade with other tribes to get equipment we need._";

begintalknode 24;
	state = 12;
	personality = 16;
	nextstate = -1;
	condition = 1;
	question = "I would like to learn some magic.";
 text1 = "You finish shopping.";
 code = 
  begin_shop_mode("Olander", "Olander is ancient shaman for the resistance. He teaches the members magical spells to assist in their efforts and has agreed to instruct you as well.", 8, 1, -1);
 break;

begintalknode 25;
	state = 12;
	personality = 16;
	nextstate = -1;
	condition = 1;
	question = "I need some of my items identified. (5 gold)";
 text1 = "Olander's old eyes peer over your equipment. You see them flash with knowledge as he does. _My rate is 5 gold. Tell me what you need to know._";
 action = ID 5;

begintalknode 26;
	state = 8;
	personality = 16;
	nextstate = 13;
	condition = (get_sdf(3,14) == 1);
	question = "I hear you have a teleporter here. Is this true?";
	text1 = "He seems somewhat annoyed that the secret is out. _Among the ancient machines, we managed to find what you call this teleporter. It was not operational, but we managed to find power sources to charge it._";
 text2 = "_We have been experimenting with it for a few months now. We think we now understand how to target it, but it is not that accurate. The best we can do is with the old transport platforms we built for Asmur._";

begintalknode 27;
	state = 13;
	personality = 16;
	nextstate = -1;
	condition = (get_sdf(3,14) == 1);
	question = "Tell me about these transport platforms.";
	text1 = "_When I was a part of Asmur, we figured out how to build and operate them. During the years before the cleansing movement, we developed a lot of wonderful things. Too bad we had to mess it all up..._";
 text2 = "He pauses and refocuses. _They were difficult to construct and required lots of crystals. I don't know how we figured so much out. It was like a magical revelation just dawned on us._";
 text3 = "_I've always wondered how we did it. Seeing Vikida's advancement parallel Asmur's, I suspect the two were caused by similar events. Why, I wish I knew._";

begintalknode 28;
	state = 8;
	personality = 16;
	nextstate = -1;
	condition = (get_sdf(3,15) == 1);
	question = "What do you study in the other lab?";
	text1 = "_I see you've been exploring a bit. We study the alien machines. Some are quite volatile and need to be handled carefully. We try to keep prying people out of there for their own protection._";

begintalknode 29;
	state = -1;
	personality = 17;
	nextstate = 14;
	condition = 1;
	question = "Nablar";
	text1 = "A gruff Nephil practices fighting techniques with a crude long broadsword. When you approach he bows, _Greetings, allies, I am Nablar. What can I do for you?_";
 text2 = "You recall this gruff Nephilim. You spoke with him earlier in the bazaar in Vikida. You had suspicions that he was involved in the resistance, but his presence has confirmed them.";
 text3 = "Currently he is practicing with a crude long broadsword. He puts it aside and approaches you. _I see you have chosen to join us. Welcome. What can I do for you?_";
code =
 clear_strings();
 if (get_sdf(2,6) == 0)
  add_string(1);
 else {
  add_string(2);
  add_string(3);
 }
break;

begintalknode 30;
	state = 14;
	personality = 17;
	nextstate = 15;
	condition = 1;
	question = "Why did you join the resistance?";
	text1 = "He smiles. _My reasons aren't like everybody else's. Most came here because their village was purged or were exiled for some reason or another. I joined on my own because it presented a unique opportunity._";
 text2 = "_I like my tribe of Vikida, but I disagree with the course of action. More importantly, I want a say in the future process after we remove Arivan from power._";

begintalknode 31;
	state = 15;
	personality = 17;
	nextstate = -1;
	condition = 1;
	question = "So then I take it you are motivated by power?";
	text1 = "He chuckles. _You might say that. Suvar knows of my ambitions for Vikida. He encourages them, so long as I keep them to myself. I cooperate with both sides and act as a double agent, gathering information._";
 text2 = "_You see, playing both sides, while maintaining loyalty with the Resistance, gives me the greatest field of vision. Once this is over, my perspective will be vital in reestablishing order._";

begintalknode 32;
	state = 15;
	personality = 17;
	nextstate = -1;
	condition = 1;
	question = "You are pretty confident that you will win.";
	text1 = "_Oh yes, I am sure we shall. Arivan is a strong enemy, but she is ultimately narrow minded. This will be her undoing. So long as we stay hidden, she has no chance against us._";

begintalknode 33;
	state = 14;
	personality = 17;
	nextstate = 16;
	condition = 1;
	question = "What do you do here?";
	text1 = "_I act as an information agent. I go to Vikida and gather knowledge and bring it back here, along with other supplies and such. I just restocked our supplies, if you're interested._";
 text2 = "_Since it costs me money to get these, I have to charge for them, but my rates are reasonable to our allies._";

begintalknode 34;
	state = 16;
	personality = 17;
	nextstate = -1;
	condition = 1;
	question = "I could use some supplies.";
 text1 = "You finish shopping.";
 code = 
  begin_shop_mode("Resistance Arms", "Nablar brings supplies from the outside world. Because this involves bartering and often a good deal of risk, he charges a reasonable rate for them.", 14, 1, 1);
 break;

begintalknode 36;
	state = -1;
	personality = 18;
	nextstate = 17;
	condition = 1;
	question = "Endora";
	text1 = "A young Nephil shaman wanders about in thought. She looks up at you, eyes you curiously, and bows. _Greetings, strange creatures. I am Endora._";
 text2 = "You remember this woman. She was the shaman in Vikida. When you last saw her, she was on the verge of a nervous break down. Now she seems relaxed and in deep thought.";
 text3 = "She, of course, recognizes you too. _Welcome again friends. I'm glad you made it here. I hope my assistance was helpful,_ referring to the potion she gave you.";
code =
 clear_strings();
 if (get_sdf(2,4) == 0)
  add_string(1);
 else {
  add_string(2);
  add_string(3);
 }
break;

begintalknode 37;
	state = 17;
	personality = 18;
	nextstate = 18;
	condition = 1;
	question = "Why did you join the resistance?";
	text1 = "_My days in Vikida were numbered. I became victim of the politics there. Another wanted my position as head shaman and fabricated rumors about me. I knew that I had little chance._";
 text2 = "_One named Nablar identified me as a potential ally and approached me. The choice was simple. I escaped with him before the soldiers came to arrest me for crimes against the tribe. Now I can never go back._";

begintalknode 38;
	state = 18;
	personality = 18;
	nextstate = -1;
	condition = 1;
	question = "Is that common in Vikida?";
	text1 = "_I regret to say that it is. Arivan's rule is dangerous, fraught with competition and constant vying for political favor. She sees this struggle as some holy survival quest. I see it as a reaper of lives._";
 text2 = "_I hope to stop this one day. If she can be defeated, we can install a new order based on fairness and equality. It is what I always believed anyway, but I could never voice my views before this._";

begintalknode 39;
	state = 18;
	personality = 18;
	nextstate = -1;
	condition = 1;
	question = "Who is Nablar?";
	text1 = "_You might have met him. He's one of the Resistance's primary agents in Vikida. He travels back and forth bringing information and supplies. I believe he is in the practice area that way._";
 text2 = "She points to the west.";

begintalknode 40;
	state = 17;
	personality = 18;
	nextstate = 19;
	condition = 1;
	question = "Do you think you could help me?";
	text1 = "She smiles. _Of course I can. I have a deep knowledge of the healing arts. For a mere donation of 25 gold for food and necessities, I will bestow this gift upon you._";

begintalknode 41;
 state = 19;
 personality = 12;
 nextstate = -1;
 condition = 1;
 question = "Yes, I definitely need healing. (Pay 25 gold)";
 text1 = "_I would like to help you, but it is professional requirements to ask for a meagar payment for these services._";
 text3 = "_Come back if someone needs healing._";
 text5 = "You pay Endora. She focuses on you and chants. Warm, white light engulfs you, restoring you to full health.";
code =
  clear_strings();
  if (coins_amount() < 25)
   add_string(1);
   else if (run_select_a_pc(1) == 0)
    add_string(3);
    else {
     play_sound(24);
     add_string(5);
     restore_pc(get_selected_pc());
     change_coins(-25);
     }
break;

begintalknode 42;
 state = 19;
 personality = 12;
 nextstate = 17;
 condition = 1;
 question = "No, I really do not need that right now.";
 text1 = "She frowns. _Well, if you change your mind, come back._";

begintalknode 43;
	state = 18;
	personality = 18;
	nextstate = 20;
	condition = (get_sdf(2,4) > 0)
	question = "Just curious, why did you give us the potion in Vikida?";
	text1 = "She grins. _I had already been contacted by the resistance. I knew my time in Vikida as shaman was short. I was told by my contact to provide help should you be worthy of it. He seemed very interested in you._";
 text2 = "_Since I needed to escape, I followed his request and got my hands on a potion to help you out in case you were interested in the resistance. It was a way to help gague your loyalties and reward, I suspect._";

begintalknode 44;
	state = 20;
	personality = 18;
	nextstate = -1;
	condition = (get_sdf(2,4) > 0)
	question = "Strange. Who was your contact anyway?";
	text1 = "_His name was Nablar. He is in the practice hall._ She points west. _Upon your arrest, he became very interested in you and asked me to find out anything I could._";